<div ng-controller="TypeManageCtrl" class="typemanage">
  <div class="text-right bg-danger pd">
    <span class="btn btn-danger btn-sm" ng-click="toAdd();">添加</span>
    <span class="btn btn-danger btn-sm" ng-click="query();">刷新</span>
  </div>
  <div>
    <table class="table table-hover">
      <thead>
        <tr class="bg-danger">
          <th>行号</th>
          <th>分类类别</th>
          <th>分类描述</th>
          <th>是否启用</th>
          <th>最后修改时间</th>
          <th>操作</th>
        </tr>
      </thead>
      <tr ng-repeat="d in list" ng-class="{true:'bg-info',false:'bg-danger'}[$index%2==0]">
        <td><span ng-bind="$index+1"></span></td>
        <td><span ng-bind="d.typeName"></span></td>
        <td><span ng-bind="d.typeInfo"></span></td>
        <td>
          <span ng-if="d.isEnable=='y'">启用中</span>
          <span ng-if="d.isEnable!='y'">禁用中</span>
        </td>
        <td>
          <span show-time="{{d.lastupdate}}" format="y-M-d h:m:s"></span>
        </td>
        <td>
          <span class="btn btn-danger" ng-if="d.isEnable=='y'" ng-click="toDelete(d);">禁用</span>
          <span class="btn btn-primary" ng-if="d.isEnable=='n'" ng-click="toUnDelete(d);">启用</span>

          <span class="btn btn-danger btn-sm" ng-click="toUpdate(d);">修改</span>

        </td>
      </tr>
    </table>
    <nav class="text-center" ng-if="page.pageCount>1">
      <ul class="pagination">
        <li>
          <a href="javascript:void(0);" ng-click="toPage(1)">首页</a>
        </li>
        <li>
          <a href="javascript:void(0);" ng-click="toPage(page.pageNumber-1)">上一页</a>
        </li>
        <li>
          <a href="javascript:void(0);">
            {{page.total}}/{{page.pageNumber}}/{{page.pageCount}}
          </a>
        </li>
        <li>
          <a href="javascript:void(0);" ng-click="toPage(page.pageNumber+1)">下一页</a>
        </li>
        <li>
          <a href="javascript:void(0);" ng-click="toPage(page.pageCount)">尾页</a>
        </li>
      </ul>
    </nav>
  </div>
</div>